﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;
using Pay.TO;

namespace Pay.DTO {
	/// <summary>
	/// 购物车
	/// </summary>
	[Serializable]
	
	public class cart_dto {
		public cart_dto() {
		}


        /// <summary>
        /// id    
        /// </summary>
        public long id { get; set; }
        /// <summary>
        /// 用户id      
        /// </summary>
        public long merchant_id { get; set; }
        /// <summary> 
        /// 产品Id
        /// </summary>
        public long product_id { get; set; }
        /// <summary>
        /// SKUID
        /// </summary>
        public long? sku_id { get; set; }
        /// <summary>
        /// 店铺id
        /// </summary>
        public long shop_id { get; set; }
        ///// <summary>
        ///// 分享店铺id
        ///// </summary>
        //public long distribution_shop_id { get; set; }
        /// <summary>
        ///分享人商户号
        /// </summary>
        public string merchant_no { get; set; }
        /// <summary>
        /// 购买数量
        /// </summary>
        public int quantity { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        public virtual merchant_dto User { get; set; }
        /// <summary>
        /// 产品
        /// </summary>
        public virtual product_dto product { get; set; }
        /// <summary>
        /// 规格表
        /// </summary>
        public virtual product_sku_dto product_sku { get; set; }
        /// <summary>
        /// 店铺信息
        /// </summary>
        public virtual shop_info_dto shop { get; set; }
    }
    /// <summary>
    /// 添加购物
    /// </summary>
    public class AddCartModel {
        [Required]
        public long product_id { get; set; }
        public long sku_id { get; set; }
        [Required(ErrorMessage ="请选择数量")]
        public int num { get; set; }
        /// <summary>
        /// 分享商户号
        /// </summary>
        public string merchant_no { get; set; }
        /// <summary>
        /// 登录用户id
        /// </summary>
        public long merchant_id { get; set; }
        /// <summary>
        /// 店铺id(用户id)
        /// </summary>
        public long shop_id { get; set; }
        ///// <summary>
        ///// 分享店铺id
        ///// </summary>
        //public long distribution_shop_id { get; set; }
    }
	public class ordermodel {
		public int quantity { get; set; }
		public long productid { get; set; }
		public long merchantid { get; set; }
		public long skuid { get; set; }
		public string image { get; set; }
		public string name { get; set; }
		public decimal price { get; set; }
		public decimal money { get; set; }
		public product_dto product { get; set; }
		public merchant_dto merchant { get; set; }
	}
    /// <summary>
    /// 购物车 显示
    /// </summary>
    [Serializable]
    public class cart_info_dto {
        public List<cart_item_dto> cartitems{get;set;}
        /// <summary>
        /// 失效商品
        /// </summary>
        public List<product_cart_dto> products { get; set; }
    }
    public class cart_item_dto {
        public shop_cart_dto shop { get; set; }
        public List<product_cart_dto> products { get; set; }
    }
	public class CartModel { 
		public long user_id { get; set; }
		public string share_no { get; set; }
		public string cache_no { get; set; }
		public List<ordermodel> ordermodel { get; set; }
	}
    public class check_cart_dto {

    }
	public class CartPayModel { 
		/// <summary>
		/// 订单号
		/// </summary>
		public string pay_no { get; set; }
		/// <summary>
		/// 用户id
		/// </summary>
		public long user_id { get; set; }
		/// <summary>
		/// 商户号
		/// </summary>
		public string merchant_no { get; set; }
		/// <summary>
		/// 请求方法
		/// </summary>
		public string method { get; set; }
		/// <summary>
		/// vip
		/// </summary>
		public string user_level_vip { get; set; }
		/// <summary>
		/// 代理商
		/// </summary>
		public string user_level_top { get; set; }
		/// <summary>
		/// 异步通知
		/// </summary>
		public string notify { get; set; }
		/// <summary>
		/// 同步通知
		/// </summary>
		public string front_notify { get; set; }
		/// <summary>
		/// 客户端ip
		/// </summary>
		/// <value>The ip.</value>
		public string ip { get; set; }
	}
}